Skip to content

feat(nav3): [Part 7] Add the built-in SerialName mapper - #6703

Open
0xadam-brown wants to merge 2 commits into
feat/nav3-serial-name-mappers-6from
feat/nav3-serial-name-mappers-7
Open

0xadam-brown wants to merge 2 commits into
feat/nav3-serial-name-mappers-6from
feat/nav3-serial-name-mappers-7

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Nav3 Serial Name Mappers)


📜 Description

PR introduces the simpler of our two built-in BackStackEntryMappers, viz., SerialName. Apps can pass it to SentryNavEffect instead of maintaining a mapping for every nav destination. Names come from serialization descriptors. No entry properties are collected.

Serializer lookup depends on the host app’s types, serialization runtime, and R8 config. This PR adds compatibility probing, cached per-type lookup results, and diagnostic warnings.

Entries that can't be named remain in the recorded back stack as "/unknown"; a failure involving one app type does not disable naming for other types.

The SDK compiles and tests against kotlinx.serialization 1.7.3 without imposing that version on host apps. The floor lives in a separate version catalog so later R8 coverage can run automatically when it changes without running for every unrelated dependency bump.

💡 Motivation and Context

Apps that use kotlinx.serialization already give each serializable route a name that does not depend on its obfuscated runtime class name. Reusing that naming contract avoids requiring applications to write a mapper for every route type.

addresses: JAVA-787 (link)

💚 How did you test it?

  • Unit tests
  • R8 tests
  • New sample app facilities + manual clanker tests

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Continue with PR 8: Define bounded property encoding.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 8e69a38

@sentry

sentry Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: not classified

For commit 8e69a38.

The last run ended with status provider_error, so this pull request has no risk label.

@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Nov 20, 2026
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Nav3 Mappers 7] Add the SerialName mapper feat(nav3): [Part 7] Add the SerialName mapper Nov 20, 2026
Comment thread gradle/nav3.versions.toml
@@ -0,0 +1,15 @@
# Versions for sentry-android-navigation3's kotlinx.serialization compatibility checks, registered as

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Note that I've created a new nav3.versions.toml file alongside our libs.versions.toml.

It lets changes to the min supported kotlinx.serialization version automatically trigger the new R8 emulator tests (introduced in a later PR – not sure what my clanker was up to w/r/t these PR splits, but whatevs).

Those tests deliberately ignore changes confined to libs.versions.toml, since otherwise Dependabot’s frequent dependency bumps would each start an emulator run. GitHub’s path filters match whole files, so keeping the floor in that shared catalog would also exclude the changes we do need to test.

My clanker told me multiple version catalogs is a common convention, but chime in if you have concerns.

Alternatives

  • Detect changes to the specific version entry in a CI job -> Would add workflow logic which was somewhat subtle and spread over both existing and new workflows.
  • Require a manual run whenever the floor version changes -> Relies on one of us remembering, and we almost certainly won't.

@0xadam-brown 0xadam-brown changed the title feat(nav3): [Part 7] Add the SerialName mapper feat(nav3): [Part 7] Add the built-in SerialName mapper Nov 20, 2026
@0xadam-brown
0xadam-brown marked this pull request as ready for review November 20, 2026 15:33
@0xadam-brown
0xadam-brown requested review from a team and adinauer as code owners November 20, 2026 15:33
@0xadam-brown
0xadam-brown requested review from markushi and runningcode and removed request for a team November 20, 2026 15:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8e69a38. Configure here.

// unresolved, avoiding repeated lookups. Entries use UNKNOWN_ENTRY_NAME.
ExceptionUtils.rethrowIfFatal(t)
error = t
null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User serializer failures lack docs

Medium Severity

New broad Throwable catches wrap host-app serializer and descriptor code, then cache the type as unresolved. A failure is visible in Sentry only as /unknown, and the warning is logged only when debug is on. The KDoc points at a troubleshooting section in sentry-docs, but this PR does not link a docs PR and the docs checkbox is unchecked, so customers have no documented way to learn that their serializer is what broke naming.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bugbot

Reviewed by Cursor Bugbot for commit 8e69a38. Configure here.

@0xadam-brown 0xadam-brown added the deep-dive PR needs a thorough review of design, behavior, and edge cases label Nov 20, 2026
@0xadam-brown 0xadam-brown added sanity-check PR needs a lightweight review for obvious issues and removed deep-dive PR needs a thorough review of design, behavior, and edge cases labels Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant